#ifndef _DNSDIG_H
#define _DNSDIG_H
#include"PublicTool.h"
#define DEFAULT_DNS_TIMEOUTMS   3000
#define DEFAULT_DNS_TRYTIMES    3



typedef struct tag_Recordinfo{
	unsigned int  queryCnt; /*请求次数*/
	unsigned long queryCostTime;   /*请求时间*/
	char server[40];        /*DNSIP*/
	unsigned int ttl;	/*缓存时长*/
	char host[128];    /*主机IP*/
	char hosts;//是否来自/etc/hosts文件
}recordinfo;

typedef struct Node{
    recordinfo data;
    struct Node *next;
}SLNode;


/* getDigInfoByDomain
	dns请求
*/
//默认要求ipv4
SLNode*dlgethostbyname(const char*domain,SETIPLIST dnslist,int timeoutms=DEFAULT_DNS_TIMEOUTMS,int trytimes=DEFAULT_DNS_TRYTIMES,int iptype=4);
/*释放*/
void Destroy(SLNode**L);
/*打印*/
void PrintDNSInfo(SLNode*result,const char*domain);

#endif
